package cn.tedu.test;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/ServletDemo01")
public class ServletDemo01 extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        request.setCharacterEncoding("utf-8");
        String m = request.getMethod();
        String user = request.getParameter("user");
        String pwd = request.getParameter("pwd");
        System.out.println("daPost===="+user+pwd+"----"+m);


    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        String m = request.getMethod();
        String user = request.getParameter("user");
        String pwd = request.getParameter("pwd");
        System.out.println("doGet..."+user+pwd+"----"+m);
    }
}
